<!DOCTYPE html>
<html lang="en">
<head>
    <style>
        div{
            height: 80px;
            width: 80px;
            background-color: red;
            margin: 5px;
            float: left;
        }

        /*绝对定位*/
        #div1{
            position: absolute;
            left: 500px;
            top: 300px;
            z-index: 9;
            /*圆角*/
            border-radius: 15px 40px;
            /*线性渐变*/
            background: linear-gradient(right,red,white, blue); /* 标准的语法 */
            background: -webkit-linear-gradient(right,red,white, blue); /* Safari chrome 5.1 - 6.0 */
            background: -o-linear-gradient(right,red, blue); /* Opera 11.1 - 12.0 */
            background: -moz-linear-gradient(right,red, blue); /* Firefox 3.6 - 15 */

            transition: transform 2s;
            -webkit-transition: -webkit-transform 2s;

            -ms-transform:scale(2,3); /* IE 9 */
            -webkit-transform: scale(2,3); /* Safari */
            transform: scale(2,3); /* 标准语法 */
        }
        /*相对定位*/
        #div2{
            position: relative;
            left: 450px;
            top: 650px;
            background-color: blue;
            z-index: -10;
            /*线性渐变*/
            background: -webkit-linear-gradient(left,rgba(255,0,0,0),rgba(255,0,0,0.6)); /* Safari 5.1 - 6 */
            background: -o-linear-gradient(right,rgba(255,0,0,0),rgba(255,0,0,0.6)); /* Opera 11.1 - 12*/
            background: -moz-linear-gradient(right,rgba(255,0,0,0),rgba(255,0,0,1)); /* Firefox 3.6 - 15*/
            background: linear-gradient(to right, rgba(255,0,0,0.3), rgba(255,0,0,0.6)); /* 标准的语法 */

            transition: transform 2s;
            -webkit-transition: -webkit-transform 2s;

            transform: translate(50px,100px);
            -ms-transform: translate(50px,100px); /* IE 9 */
            -webkit-transform: translate(50px,100px); /* Safari and Chrome */

            /* Rotate div */
            transform:rotate(30deg);
            -ms-transform:rotate(30deg); /* IE 9 */
            -webkit-transform:rotate(-30deg); /* Safari and Chrome */
        }


    </style>
    <meta charset="UTF-8">
    <title>相对定位和决定定位</title>
</head>
<body>
<div id="div1">
div1

</div>
<div id="div2">
div2

</div>
<div id="div3">
div3

</div>
<div id="div4">
div4

</div>
</body>
</html>